<?php

class Retailer_Backend_Block_Adminhtml_Backend_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
{ 
  protected function _prepareForm()
  {
      $form = new Varien_Data_Form();
      $this->setForm($form);
      $form->setDataObject(Mage::registry('backend_data'));
      $session = Mage::getSingleton('adminhtml/session');
      $fieldset = $form->addFieldset('backend_form', array('legend'=>Mage::helper('backend')->__('Product information')));
     
      $fieldset->addField('name', 'text', array(
          'label'     => Mage::helper('backend')->__('Name'), //Mage::getModel('admin/user')->load($session->getId())->getId()
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'name',
      ));

      $fieldset->addField('price', 'text', array(
          'label'     => Mage::helper('backend')->__('Price'),
          'required'  => false,
          'name'      => 'price',
      ));

//      $fieldset->addField('username', 'select', array(
//          'label'     => Mage::helper('backend')->__('Username(security reasons)'),
//          'required'  => true,
//          'name'      => 'username',
//      ));
//
//      $fieldset->addField('password', 'text', array(
//          'label'     => Mage::helper('backend')->__('Password(security reasons)'),
//          'required'  => true,
//          'name'      => 'password',
//      ));
//
      $fieldset->addField('addTo', 'select', array(
          'label'     => Mage::helper('backend')->__('Add to Website'),
          'name'      => 'addTo',
          'values'    => array(
              array(
                  'value'     => 1,
                  'label'     => Mage::helper('backend')->__('Yes'),
              ),

              array(
                  'value'     => 2,
                  'label'     => Mage::helper('backend')->__('No'),
              ),
          ),
      ));
//
//      $fieldset->addField('content', 'editor', array(
//          'name'      => 'content',
//          'label'     => Mage::helper('backend')->__('Content'),
//          'title'     => Mage::helper('backend')->__('Content'),
//          'style'     => 'width:700px; height:500px;',
//          'wysiwyg'   => false,
//          'required'  => false,
//      ));
                
     
      if ( Mage::getSingleton('adminhtml/session')->getBackendData() )
      {
          $form->setValues(Mage::getSingleton('adminhtml/session')->getBackendData());
          Mage::getSingleton('adminhtml/session')->setBackendData(null);
      } elseif ( Mage::registry('backend_data') ) {
          $form->setValues(Mage::registry('backend_data')->getData());
      }
      return parent::_prepareForm(); 
  }
}